<?php
include "../config/mysql.php";
 session_start();
// $_SESSION['id']="会话";

header("content-type:text/html;charset=utf-8");
$username=$_POST["username"];
$password=$_POST["password"];
$pdo->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL);
$rs = $pdo -> query("select * from user where username='$username' and password='$password'");
$rs->setFetchMode(PDO::FETCH_ASSOC);
if($rs->rowCount()){

	$_SESSION['username']=$username;
	header("refresh:3;url=../index.php");
   	print('登入成功，请稍等...<br>三秒后自动跳转到首页~~~');
   

}
else{

	header("refresh:3;url=../log.php");
   	print('用户名或密码错误,...<br>三秒后自动跳转到登入界面,请重新登入~~~');
}


?>